//////////////////////////////////////////////////
//Vejares - Varieties of State-Building Figure 9//
//////////////////////////////////////////////////

tsset pcode year

drop if year > 1880

**Expenses on wages**
bysort year: gen magallanes = totexp if pcode == 1
label variable magallanes "Magallanes"

bysort year: gen chiloe = totexp if pcode == 2
label variable chiloe "Chiloe"

bysort year: gen llanquihue = totexp if pcode == 3
label variable llanquihue "Llanquihue"

bysort year: gen valdivia = totexp if pcode == 4
label variable valdivia "Valdivia"

bysort year: gen arauco = totexp if pcode == 5
label variable arauco "Arauco"

bysort year: gen concepcion = totexp if pcode == 6
label variable concepcion "Concepcion"

bysort year: gen nuble = totexp if pcode == 7
label variable nuble "Nuble"

bysort year: gen maule = totexp if pcode == 8
label variable maule "Maule"

bysort year: gen talca = totexp if pcode == 9
label variable talca "Talca"

bysort year: gen colchagua = totexp if pcode == 10
label variable colchagua "Colchagua"

bysort year: gen santiago = totexp if pcode == 11
label variable santiago "Santiago"

bysort year: gen valparaiso = totexp if pcode == 12
label variable valparaiso "Valparaiso"

bysort year: gen aconcagua = totexp if pcode == 13
label variable aconcagua "Aconcagua"

bysort year: gen coquimbo = totexp if pcode == 14
label variable coquimbo "Coquimbo"

bysort year: gen atacama = totexp if pcode == 15
label variable atacama "Atacama"

bysort year: gen biobio = totexp if pcode == 17
label variable biobio "Bio-bio"

bysort year: gen linares = totexp if pcode == 18
label variable linares "Linares"

bysort year: gen curico = totexp if pcode == 19
label variable curico "Curico"

bysort year: gen antofagasta = totexp if pcode == 20
label variable antofagasta "Antofagasta"

bysort year: gen tarapaca = totexp if pcode == 21
label variable tarapaca "Tarapaca"

bysort year: gen ohiggins = totexp if pcode == 22
label variable ohiggins "ohiggins"

bysort year: gen tacna = totexp if pcode == 23
label variable tacna "Tacna"

bysort year: gen malleco = totexp if pcode == 24
label variable malleco "Malleco"

bysort year: gen cautin = totexp if pcode == 25
label variable cautin "Cautin"

bysort year: egen meanreal = mean(totexp) if pcode == 1 | pcode == 2 | pcode == 3 | pcode == 4 | pcode == 5 | pcode == 7 | pcode == 8 | pcode == 9 | pcode == 10 | pcode == 11 | pcode == 12 | pcode == 13 | pcode == 14 | pcode == 17 | pcode == 18 | pcode == 19 | pcode == 20 | pcode == 22 | pcode == 24 | pcode == 25
label variable meanreal "Mean"

line atacama conce meanreal year, xlabel(1845(5)1880) ylabel(0(5000)25000) ytitle("Pesos") xtitle("") 


///////////////////////////////////
